@extends('home.parent')
@section('title','修改消息')
@section('head_js')
@endsection
@section('head_css')
@endsection
@section('content')
<div class="content-wrapper">
  <section class="content-header">
    <h1>
      修改消息
      <small></small>
    </h1>
    <ol class="breadcrumb">
      <li><a href="{{URL('admin')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
      <li><a href="{{URL('admin/message/list')}}">消息管理</a></li>
      <li class="active">修改消息</li>
    </ol>
  </section>
  <section class="content">
    <div class="row">
      <div class="col-md-6">
        <!-- general form elements -->
        <div class="box box-primary">
          <form role="form" action="{{URL('admin/message/edit/save').'/'.$data['id'] }}" method="post" id="data_form">
            <div class="box-body">
              <div class="form-group">
                <label for="title">消息标题<span style="color: red">*</span></label>
                <input type="text" class="form-control" id="title" name="title" value="{{ $data['title'] }}" placeholder="请输入消息标题" required>
              </div>
              <div class="form-group">
                <label for="content">消息内容<span style="color: red">*</span></label>
                <textarea class="form-control" id="content" name="content" rows="5" placeholder="请输入消息内容">{{ $data['content'] }}</textarea>
              </div>
            </div>
            <!-- /.box-body -->
            <div class="box-footer">
              <button type="submit" class="btn btn-primary">提 交</button>
              <button type="button" class="btn btn-danger pull-right" onclick="history.go(-1)">取 消</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </section>
</div>
@endsection
@section('foot_js')
<script src="{{ asset('/js/apk.js') }}"></script>
<script src="{{ asset('/js/tools.js') }}"></script>
<script>
$(document).ready(function(){
  $('#data_form').submit(function(){
    var title = $.trim($("#title").val());
    var content = $.trim($("#content").val());
    if(title == ''){
      layer.msg('请输入消息标题',{icon:2});
      return false;
    }
    if(content == ''){
      layer.msg('请输入消息内容',{icon:2});
      return false;
    }
layer.msg('修改成功',{icon:1});
  })
})
</script>
@endsection